<style>
.dialog-div {background-color:#00000077;position:fixed;left:0;right:0;top:0;bottom:0;display:flex;align-items:center;overflow:auto}
.dialog-div div {flex-grow:1}
</style>
<div id="feedbackDialog" class="dialog-div" style="display:none">
    <div></div>
    <div style="background-color: white; width: 300px; padding: 0 12px">
        <a href="javascript:;" style="font-size:22px;padding:6px;color:black;text-decoration:none;float: right;top:0;right:0" onclick="this.parentNode.parentNode.style.display = 'none'">×</a>
        <h2>举报/反馈/建议</h2>
        <form method="post" action="./feedbackcommit" onsubmit="return submitCheck()">
            <input type="hidden" name="article_id"/>
            <input type="hidden" name="path"/>
            <div style="word-break:keep-all">
                <span>我要&nbsp;</span>
                <span><input type="radio" name="type" value="accusation" checked />举报</span>
                <span><input type="radio" name="type" value="feedback" />反馈</span>
                <span><input type="radio" name="type" value="advise" />建议</span>
            </div>
            <p>相关内容</p>
            <textarea type="text" name="relate_content" readonly="readonly" style="width:90%;max-width:26em;background-color:gainsboro"></textarea>
            <p>详情描述</p>
            <textarea type="text" name="description" style="width:90%;max-width:26em"></textarea>
            <p>答复邮箱&nbsp;<input type="text" name="email" /><br/>(我们会尽快处理，并将处理结果发此邮箱)</p>
            <p>验证码&nbsp;<input type="text" name="captcha" style="width:6em" /><img id="captcha-feedback" style="vertical-align: middle; margin:5px" height="32" onclick="this.setAttribute('src','./captcha?'+new Date().getTime())" /><input type="submit" /></p>
        </form>
    </div>
    <div></div>
</div>
<script>
function showFeedbackDialog(article_id, path, relate_content){
    let dialog = document.getElementById("feedbackDialog");
    dialog.style.display = "flex";
    document.getElementById('captcha-feedback').onclick();
    document.getElementsByName('article_id')[0].setAttribute('value', article_id);
    document.getElementsByName('path')[0].setAttribute('value', path);
    document.getElementsByName('relate_content')[0].innerText = relate_content;
}
</script>